package cn.adviceclient.features.module.impl.render;

import cn.adviceclient.AdviceClient;
import cn.adviceclient.event.impl.Render2DEvent;
import cn.adviceclient.features.module.Category;
import cn.adviceclient.features.module.Module;
import cn.adviceclient.features.value.BooleanSetting;
import cn.adviceclient.features.value.StringSetting;
import cn.adviceclient.gui.font.FontRenderer;
import cn.adviceclient.gui.font.Fonts;
import cn.adviceclient.utility.render.ColorUtils;

import java.awt.*;

public class HUD extends Module {
    private final BooleanSetting watermark = new BooleanSetting("WaterMark","Watermark.",true);
    private final StringSetting clientName = new StringSetting("ClientName", "Client name to display.", AdviceClient.CLIENT_NAME, () -> watermark.getValue());

    public HUD(){
        super("HUD","Display some useful widgets.", Category.RENDER);
        this.settings.add(watermark);
        this.settings.add(clientName);
        this.enabled = true;
    }

    @Override
    public void onRender2D(Render2DEvent event){
        if(watermark.getValue()) {
            FontRenderer fr = Fonts.interSemiBold.get(25);
            fr.drawString(clientName.getValue(), 10f, 10f, ColorUtils.getColor(255, 255, 255, 255));
        }
    }
}
